package com.ahdms.es;

import com.ahdms.es.bean.CertInfo;
import com.ahdms.es.bean.SealInfo;
import com.ahdms.es.bean.SesSignInfo;
import com.ahdms.es.engine.FileVerifyEngine;
import com.ahdms.es.engine.SeSealVerifyEngine;
import com.ahdms.es.engine.SesSignatureVerifyEngine;
import com.ahdms.es.engine.X509CertVerifyEngine;
import com.ahdms.es.result.VerifyResult;
import org.bouncycastle.asn1.x509.Certificate;

import java.util.List;

/**
 * @author qinxiang
 * @date 2021-04-12 11:17
 */
public class DefaultEsSignEngineDeal extends EsVerifyEngineDeal {

    @Override
    public List<VerifyResult<SesSignInfo>> verifySignByFile(byte[] fileData, String fileType) {
        return FileVerifyEngine.verify(fileData, fileType);
    }

    @Override
    public VerifyResult<SesSignInfo> verifySignBySignatureData(byte[] signatureData, byte[] src) {
        return SesSignatureVerifyEngine.verifySesSignature(signatureData, src);
    }

    @Override
    public VerifyResult<CertInfo> verifyX509Cert(Certificate cert) {
        return X509CertVerifyEngine.verifyX509Cert(cert);
    }

    @Override
    public VerifyResult<SealInfo> verifySeal(byte[] sealData) {
        return SeSealVerifyEngine.verify(sealData);
    }
}
